package cn.bsb.service.rece;



import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import cn.bsb.dao.RecommendMapper;
import cn.bsb.pojo.Article;
import cn.bsb.pojo.Recommend;
import tk.mybatis.mapper.entity.Example;
@Service("RecommendService")
public class RecommendService  extends BaseService<Recommend>{
	@Resource
	private RecommendMapper recommendMapper;
	/**
	 * 查找出推荐的前几个文章
	 * @return
	 */
	public PageInfo<Recommend> recommendList(Integer pagesize){
		PageHelper.startPage(1, pagesize);
		Example example=new Example(Article.class);
	    example.setOrderByClause("time desc");
		List<Recommend> list=recommendMapper.selectByExample(example);
		return new PageInfo<Recommend>(list);
	}

}
